Seriously Good Software: Code that works, survives, and wins by Marco Faella
Author:Marco Faella
Language: eng
Format: mobi, epub, pdf
Publisher: Manning Publications
Published: 2020-03-16T10:06:57.356000+00:00
1 The original procedure goes here (modifies u and v).
int gcd = -u * ( 1 <{}< k);
assert isGcd(gcd, originalU, originalV) : "Wrong GCD!";
return gcd;
}
For the auxiliary isGcd method, I said the simplest solution is preferable. In this case, you may simply apply the definition of “greatest common divisor,” and check that
gcd is indeed a common divisor of originalU and originalV
every larger number is not a common divisor
private static boolean isGcd(int gcd, int u, int v) {
if (u \% gcd != 0 || v \% gcd != 0) 1 Checks that gcd is a common divisor
return false;
for (int i=gcd+1; i<=u && i<=v; i++) 2 Checks any larger number,
if (u \% i == 0 && v \% i == 0) up to the minimum of u and v
return false;
return true;
}
This implementation of isGcd is very inefficient, being linear in the size of the smallest number between u and v. A more reasonable course of action would be to use Euclid’s classic algorithm (https://en.wikipedia.org/wiki/Euclidean_algorithm) or invoke an already implemented GCD procedure, such as the BigInteger.gcd() method from the JDK.
Download
Seriously Good Software: Code that works, survives, and wins by Marco Faella.epub
Seriously Good Software: Code that works, survives, and wins by Marco Faella.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Coding Theory | Localization |
Logic | Object-Oriented Design |
Performance Optimization | Quality Control |
Reengineering | Robohelp |
Software Development | Software Reuse |
Structured Design | Testing |
Tools | UML |
Deep Learning with Python by François Chollet(11922)
Hello! Python by Anthony Briggs(9386)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9352)
The Mikado Method by Ola Ellnestam Daniel Brolund(9321)
Dependency Injection in .NET by Mark Seemann(8866)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(7860)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7350)
Grails in Action by Glen Smith Peter Ledbrook(7305)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7125)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(5969)
Kotlin in Action by Dmitry Jemerov(4653)
Practical Vim (for Kathryn Amaral) by Drew Neil(3732)
Cracking the GRE Premium Edition with 6 Practice Tests, 2015 (Graduate School Test Preparation) by Princeton Review(3600)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3447)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3252)
Learning Java by Patrick Niemeyer & Daniel Leuck(2873)
Learning React: Functional Web Development with React and Redux by Banks Alex & Porcello Eve(2845)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(2836)
Microservices with Go by Alexander Shuiskov(2625)